/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package server_v1_0;

import java.io.*;
import java.net.*;

/**
 *
 * @author suhui
 */
public class serverreceiveobject {

    public static void main(String[] args) throws Exception
    {
        ServerSocket ss = new ServerSocket(7000);
    Socket socket = ss.accept();
    ObjectInputStream ois = new ObjectInputStream(
        socket.getInputStream());
        player p = (player) ois.readObject();
        InetAddress ipadd = socket.getInetAddress();
        int port = socket.getPort();
        p.setip(ipadd,port);
        System.out.println('\n');
        System.out.println(p.ipaddress + p.port + p.username);
    }
}
